package com.gobo.easyexcel.listen;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.gobo.easyexcel.pojo.DataDemo;

import java.util.ArrayList;
import java.util.List;

public class ExcelListener extends AnalysisEventListener<DataDemo> {
    List<DataDemo> dataDemos = new ArrayList<>();
    @Override
    public void invoke(DataDemo dataDemo, AnalysisContext analysisContext) {
        System.out.println(dataDemo);
        dataDemos.add(dataDemo);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println(dataDemos);
    }
}
